package com.handels.core;

import java.io.File;
import java.util.Date;

import javax.servlet.ServletConfig;

public class HAApplication{
	private static HAApplication instance;
	private static ServletConfig config;
	
	private HAApplication(ServletConfig config)
    {
		this.config = config;
    }
	
    public static HAApplication getInstance()
    {
        if(instance == null)
            instance = new HAApplication(config);
        return instance;
    }

    public static HAApplication getInstance(ServletConfig config)
    {
        if(instance == null)
            instance = new HAApplication(config);
        return instance;
    }
    
	public String getRealPath()
	{		
		return config.getServletContext().getRealPath("")+ File.separator;
	}
	
	public Date getStartDate()
	{
		return new Date();
	}

	public void setConfig(ServletConfig config) {
		this.config = config;
	}

	public ServletConfig getConfig() {
		return config;
	}
}